home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / MEMCCPY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  436 b   |  14 lines

  1. /* memccpy.c, from p.148 of Turbo C Bible  */
  2. /*   Copies bytes from one buffer to another until specific character is
  3.     encountered or until a specified number of bytes have been copied.*/
  4. #include <stdio.h>
  5. #include <mem.h>
  6. static char dest[81]; /* Destination buffer */
  7. main()
  8. {
  9.     char inbuf[81];
  10.     printf("Enter a string: ");
  11.     gets(inbuf);
  12.     memccpy(dest, inbuf, '\0', 81);
  13.     printf("Destination buffer has: %s\n", dest);
  14. }